<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/12/6
 * Time: 10:10
 */

$username = 'root';
$password = '';
$dbh = new PDO('mysql:host=localhost;dbname=sblog',$username,$password);
if($dbh){
    echo "连接数据库成功";
}else{
    echo "连接数据库失败";
}